<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'assetTeam.label', default: 'assetTeam')}"/>
    <title>新增团队资产</title>
</head>

<body>
<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增团队资产</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="asset" action="show"
                                id="${this.assetTeam?.asset?.id}">资产列表</g:link>

                    </li>
                    <li class="breadcrumb-item">新增团队资产</li>
                </ul>
            </div>
        </div>

        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message" role="status">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${this.assetTeam}">
                <ul class="errors" role="alert">
                    <g:eachError bean="${this.assetTeam}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                            <g:message error="${error}"/>
                        </li>
                    </g:eachError>
                </ul>
            </g:hasErrors>

            <div class="card">
                <div class="card-header">
                    <h5>新增团队资产</h5>

                    <div class="card-header-right">
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form action="save">
                        <div class="form-group row">
                            <label class="col-md-2 col-form-label is-required">名称</label>

                            <div class="col-md-3">
                                <input class="form-control" type="hidden" name="account.id"
                                       value="${this.assetTeam?.asset?.id}">
                                <g:select class="form-control" name="user.id" optionKey="id" from="${this.userList}"
                                          value="${this.assetTeam?.user?.id}" noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 col-form-label is-required">权限</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="teamRole.id" optionKey="id" optionValue="name"
                                          from="${com.next.TeamRole.list()}" value="${this.assetTeam?.teamRole?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 col-form-label">contactPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="contactPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.contactPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 col-form-label">activityPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="activityPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.activityPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 col-form-label">teamPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="teamPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.teamPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 col-form-label">attachmentPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="attachmentPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.attachmentPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 col-form-label">notePermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="notePermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.notePermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>

                            <label class="col-md-2 col-form-label">flexFieldPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="flexFieldPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.flexFieldPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 col-form-label">addressPermission</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="addressPermission.id" optionKey="id"
                                          optionValue="name"
                                          from="${com.next.TeamRole.list()}"
                                          value="${this.assetTeam?.addressPermission?.id}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton class="btn btn-info" name="create" value="保存"/>
                            </div>
                        </div>
                    </g:form>
                </div>

            </div>
        </div>

    </div>
</div>

</body>
</html>
